package com.eascs.admin.o2o.badloan.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.dubbo.config.annotation.Service;
import com.eascs.admin.common.vo.ModelResult;
import com.eascs.admin.o2o.badloan.dao.O2oCancleDao;
import com.eascs.admin.o2o.badloan.entity.O2oCacleEntity;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
@Service
public class IO2oCancleService {
	private static Logger logger = LoggerFactory.getLogger(IO2oCancleService.class);
	@Autowired
	O2oCancleDao cancleDao;
	@Autowired
	O2oCancleServiceImpl o2oCancleServiceImpl;
	@Transactional(transactionManager = "o2oTransactionManager")
	public ModelResult<Boolean> IworlFlowCancle(O2oCacleEntity payform){
		ModelResult<Boolean> modelResult = new ModelResult<Boolean>();
		int i = cancleDao.insert(payform);
		if (i > 0) {
			modelResult = o2oCancleServiceImpl.worlFlowCancle(payform);
		} else {
			modelResult.withError("auto cacle fail,reson:[{}]", "insert into o2o_loan_t_info is error");
		}
		return modelResult;
	}
}
